﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Babylon.Toolbox
{
    /// <summary>
    /// Settings used to generate, display and make live 3D particles
    /// </summary>
    public class ParticleSettings
    {
        /// <summary>
        /// get or set the maximum particle count for the given system
        /// (influences memory usage, memory bandwidth,...)
        /// </summary>
        public int MaxParticleCount { get; set; }

        /// <summary>
        /// get or set the texture of the particle
        /// </summary>
        public Texture2D Texture { get; set; }

        /// <summary>
        /// Get or set the minimum size of a particle (at start)
        /// </summary>
        public float MinStartSize { get; set; }

        /// <summary>
        /// Get or set the maximum size of a particle (at start)
        /// </summary>
        public float MaxStartSize { get; set; }


        /// <summary>
        /// Get or set the minimum size of a particle (at end)
        /// </summary>
        public float MinEndSize { get; set; }


        /// <summary>
        /// Get or set the maximum size of a particle (at end)
        /// </summary>
        public float MaxEndSize { get; set; }

        private float _alphaRatio = 1;

        /// <summary>
        /// Get or set the alpha ratio to apply to the output color
        /// </summary>
        public float AlphaRatio
        {
            get { return _alphaRatio; }
            set { _alphaRatio = value; }
        }

        /// <summary>
        /// Get or set the minmum velocities for each axis
        /// </summary>
        public Vector3 MinVelocityValues { get; set; }

        /// <summary>
        /// Get or set the maximum velocities for each axis
        /// </summary>
        public Vector3 MaxVelocityValues { get; set; }

        /// <summary>
        /// Get or set the amount of velocity at the end of the particle life
        /// </summary>
        public float EndVelocityRatio { get; set; }

        /// <summary>
        /// get or set the minimum rotation speed of a particle
        /// </summary>
        public float MinRotationSpeed { get; set; }

        /// <summary>
        /// get or set the maximum rotation speed of a particle
        /// </summary>
        public float MaxRotationSpeed { get; set; }

        /// <summary>
        /// get or set the environment forces (gravity / wind...)
        /// </summary>
        public Vector3 EnvironmentForces { get; set; }

        /// <summary>
        /// Get or set the minmum teint to apply to the output color
        /// </summary>
        public Vector3 MinTeint { get; set; }
        /// <summary>
        /// Get or set the maximum teint to apply to the output color
        /// </summary>
        public Vector3 MaxTeint { get; set; }

        /// <summary>
        /// Get or set the average particle life duration
        /// </summary>
        public float ParticleAvgDuration { get; set; }

        /// <summary>
        /// Get or set the amount of randomness in particle duration
        /// </summary>
        public float ParticleDurationRandomness { get; set; }

        /// <summary>
        /// Get or set the BlendState to use for this particle type
        /// </summary>
        public BlendState BlendState { get; set; }
    }
}
